import request from '@/utils/http'
import { BaseResult } from '@/types/axios'

export class AccountService {
  // 分页获取账号列表
  static getRulePage(params?: object) {
    return request.get<BaseResult>({
      url: '/chat/rule/page',
      params
    })
  }
  static getRuleOptions(params?: object) {
    return request.get<BaseResult>({
      url: '/chat/rule/ruleOptions',
      params
    })
  }

  // 删除账号
  static ruleCreate(params: object) {
    return request.post<BaseResult>({
      url: '/chat/rule/create',
      data: params
    })
  }

  static ruleUpdate(params: object) {
    return request.post<BaseResult>({
      url: '/chat/rule/update',
      data: params
    })
  }
  static ruleDelete(params: object) {
    return request.post<BaseResult>({
      url: '/chat/rule/delete',
      data: params
    })
  }

  static getChatPage(params?: object) {
    return request.get<BaseResult>({
      url: '/chat/chat/page',
      params
    })
  }

  static getChatMessagePage(params?: object) {
    return request.get<BaseResult>({
      url: '/chat/chat_message/page',
      params
    })
  }

  static sendText(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendText',
      data: params
    })
  }
  static sendVideo(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendVideo',
      data: params
    })
  }
  static sendImage(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendImage',
      data: params
    })
  }
  static sendNoteCard(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendNoteCard',
      data: params
    })
  }
  static sendPageCard(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendPageCard',
      data: params
    })
  }
  static sendCommentReply(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendCommentReply',
      data: params
    })
  }
  static sendSocialCard(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendSocialCard',
      data: params
    })
  }
  static sendLeadCard(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendLeadCard',
      data: params
    })
  }
  static sendBusinessCard(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/sendTradeBusinessCard',
      data: params
    })
  }
  static senderRevoke(params: object) {
    return request.post<BaseResult>({
      url: '/chat/sender/revoke',
      data: params
    })
  }
}
